
<%= render :partial => "admin/menu" %>

<div class="listing">

<%= render :partial => "shared/flash" %>

  <h1>Listing users</h1>
  
  <table>
    <tr>
      <th>First Name</th>
      <th>Last Name</th>
      <th>Email</th>
      <th>Admin?</th>
      <th>Developer?</th>
    </tr>

    <% @users.each do |user| %>
      <tr>
        <td><%=h user.first_name %></td>
        <td><%=h user.last_name %></td>
        <td><%=h user.email %></td>
        <td><%=h user.is_admin? %></td>
        <td><%=h user.is_dev? %></td>
        <td><%= link_to 'Edit', edit_user_path(user.user_id) %></td>
        <td><%= link_to 'Delete', user_path(user.user_id), :confirm => "Are you sure you want to delete #{user.email}?", :method => :delete %></td>
      </tr>
    <% end %>
  </table>
</div>